release.yml: flock apt-get to serialize concurrent coin package jobs - #670
Merged
Conversation
The 5 Linux coin package cells run concurrently on the single c2pool-build self-hosted host and race on /var/lib/apt/lists/lock, corrupting srcpkgcache.bin; the loser fails at Install system dependencies before the build starts (LTC on v0.2.0, run 29148852306). Wrap apt-get in a host-wide flock so the install is atomic. No-op on github-hosted runners (per-VM lock).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root-fix for the recurring self-hosted Linux apt-lock contention that flaked the LTC Linux package on v0.2.0 (run 29148852306).
Problem
The five Linux coin package cells (btc/ltc/dgb/dash/bch) run concurrently on the single `c2pool-build` self-hosted host and race on `/var/lib/apt/lists/lock`. The loser fails at Install system dependencies before its build starts; the same concurrency also produces the sibling `srcpkgcache.bin` corruption.
Fix
Wrap the two `apt-get` calls in a host-wide `flock /tmp/c2pool-apt.lock`, making the install atomic across concurrent jobs. Chosen over containerize / prebake-image because it is the smallest durable change and kills the whole class (lock race + srcpkgcache corruption) with no image-maintenance or drift cost. No-op on github-hosted runners (lock is per-VM, uncontended).
Follow-up (not this PR)
Other workflows that apt-install on the same host (build.yml smoke, gate workflows) can adopt the same `/tmp/c2pool-apt.lock` path to extend serialization cross-workflow. Scoped out to keep this change to the reported release flake.
Merge-gated — awaiting operator push-approval.